package com.cw.service;

import java.io.Serializable;
import java.util.List;
import java.util.Vector;

public interface BaseService<T> {

	public List<T> findAll();

	public T loadEntity(Serializable id);

	public T getEntity(Serializable id);

	public List<T> findEntityBySql(String sql, Object... objects);
	
	public List<Object> findPropBySql(String sql, Object...objects);

	public List<Object> findPropBySql(String sql, Integer fstRec, Integer maxRec, Object...objects);

	// write operate
	public void saveEntity(T entity);

	public void updateEntity(T entity);

	public void saveOrUpdateEntity(T entity);

	public void deleteEntity(T entity);

	// according hql to batch execute
	public void batchHandlerByHQL(String sql, Object... objects);

	public void deleteByNames(String tableName, String colName,
			Vector<String> rIds);

	public void deleteByIds(String tableName, Vector<Integer> rIds);

	public void deleteByVector(String tableName, Vector<T> objs);
}
